<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- <link rel="stylesheet" href="http://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="http://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> -->

<link rel="stylesheet" type="text/css" href="./../../html/res/css/style.css" />
<link href="./../../html/res/css/table.css" rel="stylesheet" type="text/css">
<link href="./../../html/res/css/user.css" rel="stylesheet" type="text/css">
<link href="./../../html/res/css/pager.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="./../../html/res/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="./../../html/res/js/jquery.pager.js"></script>
<script type="text/javascript" src="./../../html/res/js/util.js"></script>

<title>WBD 网络小说下载</title>
<meta name="description" content="网络小说下载">
<meta name="keyword" content="网络小说下载工具">
</head>
<body>
<div id="topbj">
<!-- $headnav$ -->
<div id="zhuce">
	<div class="zcelist"><b class="bzce">[var.out.page_title;htmlconv=no]</b></div>
    <div id="div_errormsg" class="zcelist0 hide"><b class="bzce"><span id="errormsg" style="color:#f00;"></span></b></div>
   
    [var.out.html_data; htmlconv=no;noerr]
    <div style="clear:both;padding:15px;color:#000;text-align: left;"></div>
   
</div>
<div id="jobstate">
	[var.out.jobstate; htmlconv=no;noerr]
</div>
<div id="sitelist">   
    [var.out.html_data2; htmlconv=no;noerr]       
</div>
<!-- $foot$ -->

<div class='hide'>
<textarea id='column_title_def' class='hide'>[var.out.column_title_def; htmlconv=no;noerr]</textarea>
</div>

<script type="text/javascript" src="./../../html/res/app.js?v=[var.out.js_css_ver;noerr]"></script>
<script type="text/javascript">
'use strict';

// var API_SERVER = 'http://www.shdic.com';
var API_SERVER = 'http://localhost:9980/appidf738cydm44';

var API_URL=API_SERVER+'/webapp/web_book_download/crx.php';


var jobProcessPartId=+'[var.out.jobProcessPartId; htmlconv=no;noerr]';
var jobProcessIdx=+'[var.out.jobProcessIdx; htmlconv=no;noerr]';
var column_title_def=null;
$(document).ready(function(){

	if(jobProcessPartId>=3){
		// alert(jobProcessIdx);
		var delayTime=186;
		$(".ifr_rightlist").each(function () {
			var s = $(this);
			// setTimeout(function () {
			// 	s.attr('src',s.attr('src1'));
			// 	// var id=s.attr('id');
			// 	// setTimeout(function () {
			// 	// 	//$(document.getElementById('iframeId').contentWindow.document.body).html()
			// 	// 	var src=$(document.getElementById(id).contentWindow.document.body).html();
			// 	// 	api_post_data_page2015('2016putJobsHtml',src,false,true);
			// 	// }, delayTime+3000);
			// }, delayTime);

			// var turl=url_add_mathRandom(s.attr('src1'));

			// task2link.tpl.html
			var turl=API_SERVER+'/webapp/web_book_download/index.php?a=task2link';
			turl=turl+'&url='+encodeURIComponent(s.attr('src1'));
			window.open(turl);
			return false;

			delayTime = delayTime + 300;
		});
	}	
    
});


function url_add_mathRandom(surl){
	var newurl=surl;
	if(newurl.indexOf('?')==-1){
		newurl = newurl + "?mathRandom="+Math.random();
	}else{
		newurl = newurl + "&mathRandom="+Math.random();
	}
	return newurl;

}


/*
function iframeLoadEND(){	
	jobMsg('开始处理任务');
	var htm = $("html")[0];
	jobMsg('开始提交数据');
	return api_post_data_page2015('2016putJobsHtml',htm.innerHTML,false,true);
}
*/



function api_post_data_page2015(api,dat,turl,callback){
	var loc = encodeURIComponent(location.href);
	var newurl=API_URL+'?api=api'+api+"&verkey=7&loc_url=";
	if(turl){
		newurl = newurl +turl;
	}else{
		newurl = newurl +loc;
	}	
	newurl=url_add_mathRandom(newurl);
	var formParam=null;
	if(dat){
		if(typeof(dat)!='string'){
			dat = dat.serialize();//序列化表格内容为字符串 
		}
		formParam = {p1:dat};
	}else{
		alert('error!');
		return false;
	}

	// shdic.ApiDebug.add('api_post_data_page2015',api);

	var aj = $.ajax( {
			url:newurl,
			data:formParam, 
			type:'post',
			cache:false,
			dataType:'json',
			success:function(data){				
				if(data.return_code && data.run_time){
					console.log(getFullTime()+'api_post_data_page:api'+data.return_code+' ,'+data.run_time+'秒.');
				}
				if(data.return_message){
					console.log(data.return_message);
				}
				if( callback ){
					callback();
				}
			}
		});
	return aj;
}
</script>
</body>
</html>
